package com.gxa.day2022_08_09_28.emp_dept_system.entity;

import lombok.*;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Dept {
    private Integer deptno;
    private String dname;
    private String loc;

    @Override
    public boolean equals(Object obj) {
        if(obj == this) return true;
        if(obj instanceof Dept) {
            Dept another = (Dept)obj;
            return this.deptno == another.deptno && this.dname.equals(another.getDname()) && this.loc.equals(another.getLoc());
        }
        return false;
    }

    @Override
    public String toString() {
        return this.dname;
    }
}
